/*
 * @Author: SR. 2761500454@qq.com
 * @Date: 2025-06-29 15:54:28
 * @LastEditors: SR. 2761500454@qq.com
 * @LastEditTime: 2025-06-29 18:28:35
 * @FilePath: \backend-internship\src\main\java\com\lizheng\yunservice\travel\service\impl\VtpExhibitionHallServiceImpl.java
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
package com.lizheng.yunservice.travel.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lizheng.yunservice.travel.mapper.VtpExhibitionHallMapper;
import com.lizheng.yunservice.travel.doamin.VtpExhibitionHall;
import com.lizheng.yunservice.travel.service.IVtpExhibitionHallService;
import com.lizheng.yunservice.travel.doamin.vo.VtpExhibitionHallVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 展馆服务实现类
 * 提供展馆相关业务逻辑实现
 *
 * @author SR.
 * @date 2025-06-29
 */
@Service
public class VtpExhibitionHallServiceImpl implements IVtpExhibitionHallService {
    @Autowired
    private VtpExhibitionHallMapper exhibitionHallMapper;

    /**
     * 推荐展馆分页列表（实体）
     */
    @Override
    public IPage<VtpExhibitionHall> getRecommList(Page<VtpExhibitionHall> page) {
        QueryWrapper<VtpExhibitionHall> query = new QueryWrapper<>();
        query.eq("status", 1);
        return exhibitionHallMapper.selectPage(page, query);
    }

    /**
     * 所有展馆分页列表（实体）
     */
    @Override
    public IPage<VtpExhibitionHall> getHallList(Page<VtpExhibitionHall> page) {
        return exhibitionHallMapper.selectPage(page, null);
    }

    /**
     * 推荐展馆分页列表（VO）
     */
    @Override
    public IPage<VtpExhibitionHallVo> getRecommListVo(Page<?> page) {
        QueryWrapper<VtpExhibitionHall> query = new QueryWrapper<>();
        query.eq("status", 1);
        return exhibitionHallMapper.selectVoPage(page, query);
    }

    /**
     * 所有展馆分页列表（VO）
     */
    @Override
    public IPage<VtpExhibitionHallVo> getHallListVo(Page<?> page) {
        return exhibitionHallMapper.selectVoPage(page, new QueryWrapper<>());
    }

    /**
     * 获取展馆详情（VO）
     */
    @Override
    public VtpExhibitionHallVo getHallDetailVo(Integer hallId) {
        VtpExhibitionHall entity = exhibitionHallMapper.selectById(hallId);
        if (entity == null) return null;
        VtpExhibitionHallVo vo = new VtpExhibitionHallVo();
        vo.setHallId(entity.getHallId());
        vo.setHallName(entity.getHallName());
        vo.setVerticalImgUrl(entity.getVerticalImgUrl());
        vo.setLogoUrl(entity.getLogoUrl());
        vo.setVrUrl(entity.getVrUrl());
        vo.setPropaganda(entity.getPropaganda());
        vo.setSummary(entity.getSummary());
        vo.setStatus(entity.getStatus());
        return vo;
    }
}
